package org.jks.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.GenericGenerator;

import com.google.gson.annotations.Expose;

@Entity
@Table(name = "Province")
public class Province {
	@Id
	@GeneratedValue(generator = "increment")
	@GenericGenerator(name = "increment", strategy = "increment")
	@Expose
	private long Id;
	@Column(length = 64, nullable = false)
	@Expose
	private String Name;
	@Cascade({ CascadeType.ALL })
	@OneToMany(mappedBy = "Province", fetch = FetchType.LAZY, orphanRemoval = true)
	@Expose
	private List<City> Cities;

	public long getId() {
		return Id;
	}

	public void setId(long id) {
		Id = id;
	}

	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	public List<City> getCities() {
		return Cities;
	}

	public void setCities(List<City> cities) {
		Cities = cities;
	}

}
